package com.guomei.mapper.homeData;

import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.guomei.bean.homeData.domain.Banner;
import java.util.List;

@Mapper
public interface BannerMapper extends BaseMapper<Banner> {
    List<Banner> getBanners();

    int deleteByIds(List<Long> ids);

    default List<Banner> getBannersDefault() {
        QueryWrapper<Banner> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("is_deleted", false).orderByDesc("id");
        return this.selectList(queryWrapper);
    }

    default int deleteByIdsDefault(List<Long> ids) {
        if (ids == null || ids.isEmpty()) {
            return 0;
        }
        return this.deleteBatchIds(ids);
    }
}
